package com.aiatomic.couting;

import com.aiatomic.couting.util.AppUtils;
import com.aiatomic.couting.util.SystemUtil;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;

public class AboutMeActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_about_me);
		TextView txtBack = (TextView) this.findViewById(R.id.txtBack);
		txtBack.setText(R.string.back);
		txtBack.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				onBackPressed();
			}
		});
		TextView txtNext = (TextView) this.findViewById(R.id.txtNext);
		txtNext.setVisibility(View.INVISIBLE);

		TextView txtMiddle = (TextView) this.findViewById(R.id.txtMiddle);
		txtMiddle.setVisibility(View.VISIBLE);
		txtMiddle.setText(R.string.drawer_about);
		TextView txt_about_me_version = (TextView)this.findViewById(R.id.txt_about_me_version);
		txt_about_me_version.setText(String.format(getResources().getString(R.string.txt_about_me_version), SystemUtil.getAppVersion(getApplicationContext())));
		this.findViewById(R.id.about_user_agree).setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent intent=new Intent(AboutMeActivity.this,CommWebViewActivity.class);
				intent.putExtra("title", getString(R.string.txt_about_me_user));
				intent.putExtra("url",   AppUtils.url + "/v/cAbout/user_agree");
				startActivity(intent);
			}
		});
		this.findViewById(R.id.about_private_policy).setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent intent=new Intent(AboutMeActivity.this,CommWebViewActivity.class);
				intent.putExtra("title", getString(R.string.txt_about_me_user_mimi));
				intent.putExtra("url",  AppUtils.url + "/v/cAbout/privacy_policy");
				startActivity(intent);
			}
		});
	}
}
